//
//  RequestChecker.m
//  Staff
//
//  Created by caiyao on 1/6/15.
//
//

#import "RequestChecker.h"

@implementation RequestChecker

+ (BOOL) hasAppScheme:(NSURLRequest *)request {
    
    BOOL matchFound = FALSE;
    
    //-check for built-in app functions
    if ([[[request URL] scheme] hasPrefix:@"mailto"] || [[[request URL] scheme] hasPrefix:@"sms"] || [[[request URL] scheme] hasPrefix:@"tel"])
    {
        matchFound = TRUE;
    }
    
    return matchFound;
}

+ (BOOL) hasCustomScheme:(NSURLRequest *)request {
    
    BOOL matchFound = FALSE;
    
    //-check for custom functions - ie will have http protocol specified (eg hsbc://...)
    if ([[[request URL] scheme] hasPrefix:@"hsbc"]) {
        matchFound = TRUE;
    }
    
    return matchFound;
}

@end
